#
# Source for table open_account_log
#

DROP TABLE IF EXISTS `open_account_log`;
CREATE TABLE `open_account_log` (
  `log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL,
  `user_money` decimal(10,2) NOT NULL,
  `admin_user` varchar(255) NOT NULL DEFAULT '',
  `frozen_money` decimal(10,2) NOT NULL,
  `rank_points` mediumint(9) NOT NULL,
  `pay_points` mediumint(9) NOT NULL,
  `change_time` int(10) unsigned NOT NULL,
  `change_desc` varchar(255) NOT NULL,
  `change_type` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`log_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_acl_action
#

DROP TABLE IF EXISTS `open_acl_action`;
CREATE TABLE `open_acl_action` (
  `action_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) unsigned NOT NULL DEFAULT '0',
  `type` varchar(10) NOT NULL DEFAULT '',
  `action_name` varchar(100) NOT NULL DEFAULT '',
  `action_code` varchar(50) NOT NULL DEFAULT '',
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `cid` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`action_id`),
  KEY `parent_id` (`parent_id`),
  KEY `type` (`type`),
  KEY `action_code` (`action_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;

#
# Source for table open_acl_role
#

DROP TABLE IF EXISTS `open_acl_role`;
CREATE TABLE `open_acl_role` (
  `role_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `role_name` varchar(100) NOT NULL DEFAULT '',
  `role_desc` tinytext NOT NULL,
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_acl_role_func
#

DROP TABLE IF EXISTS `open_acl_role_func`;
CREATE TABLE `open_acl_role_func` (
  `action_id` int(11) unsigned NOT NULL DEFAULT '0',
  `role_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`action_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_acl_role_user
#

DROP TABLE IF EXISTS `open_acl_role_user`;
CREATE TABLE `open_acl_role_user` (
  `role_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `user_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_ad
#

DROP TABLE IF EXISTS `open_ad`;
CREATE TABLE `open_ad` (
  `ad_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `position_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `media_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `ad_name` varchar(60) NOT NULL DEFAULT '',
  `ad_link` varchar(255) NOT NULL DEFAULT '',
  `ad_code` text NOT NULL,
  `start_time` int(11) NOT NULL DEFAULT '0',
  `end_time` int(11) NOT NULL DEFAULT '0',
  `link_man` varchar(60) NOT NULL DEFAULT '',
  `link_email` varchar(60) NOT NULL DEFAULT '',
  `link_phone` varchar(60) NOT NULL DEFAULT '',
  `click_count` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `enabled` tinyint(3) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`ad_id`),
  KEY `position_id` (`position_id`),
  KEY `enabled` (`enabled`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_ad_position
#

DROP TABLE IF EXISTS `open_ad_position`;
CREATE TABLE `open_ad_position` (
  `position_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `position_name` varchar(60) NOT NULL DEFAULT '',
  `ad_width` smallint(5) unsigned NOT NULL DEFAULT '0',
  `ad_height` smallint(5) unsigned NOT NULL DEFAULT '0',
  `position_desc` varchar(255) NOT NULL DEFAULT '',
  `position_style` text NOT NULL,
  PRIMARY KEY (`position_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_admin_log
#

DROP TABLE IF EXISTS `open_admin_log`;
CREATE TABLE `open_admin_log` (
  `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `log_time` int(10) unsigned NOT NULL DEFAULT '0',
  `user_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `log_info` varchar(255) NOT NULL DEFAULT '',
  `ip_address` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`log_id`),
  KEY `log_time` (`log_time`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_admin_message
#

DROP TABLE IF EXISTS `open_admin_message`;
CREATE TABLE `open_admin_message` (
  `message_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `sender_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `receiver_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `sent_time` int(11) unsigned NOT NULL DEFAULT '0',
  `read_time` int(11) unsigned NOT NULL DEFAULT '0',
  `readed` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `title` varchar(150) NOT NULL DEFAULT '',
  `message` text NOT NULL,
  PRIMARY KEY (`message_id`),
  KEY `sender_id` (`sender_id`,`receiver_id`),
  KEY `receiver_id` (`receiver_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_admin_user
#

DROP TABLE IF EXISTS `open_admin_user`;
CREATE TABLE `open_admin_user` (
  `user_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `user_name` varchar(60) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `password` varchar(32) NOT NULL DEFAULT '',
  `add_time` int(11) NOT NULL DEFAULT '0',
  `last_login` int(11) NOT NULL DEFAULT '0',
  `last_ip` varchar(15) NOT NULL DEFAULT '',
  `action_list` text NOT NULL,
  `nav_list` text NOT NULL,
  `lang_type` varchar(50) NOT NULL DEFAULT '',
  `agency_id` smallint(5) unsigned NOT NULL,
  `todolist` longtext,
  PRIMARY KEY (`user_id`),
  KEY `user_name` (`user_name`),
  KEY `agency_id` (`agency_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_adsense
#

DROP TABLE IF EXISTS `open_adsense`;
CREATE TABLE `open_adsense` (
  `from_ad` smallint(5) NOT NULL DEFAULT '0',
  `referer` varchar(255) NOT NULL DEFAULT '',
  `clicks` int(10) unsigned NOT NULL DEFAULT '0',
  KEY `from_ad` (`from_ad`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_affiliate_log
#

DROP TABLE IF EXISTS `open_affiliate_log`;
CREATE TABLE `open_affiliate_log` (
  `log_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) NOT NULL,
  `time` int(10) NOT NULL,
  `user_id` mediumint(8) NOT NULL,
  `user_name` varchar(60) DEFAULT NULL,
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `point` int(10) NOT NULL DEFAULT '0',
  `separate_type` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_affix
#

DROP TABLE IF EXISTS `open_affix`;
CREATE TABLE `open_affix` (
  `affix_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ctype` varchar(200) NOT NULL DEFAULT '',
  `cid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `affix_name` varchar(255) NOT NULL DEFAULT '',
  `virtual_path` varchar(255) NOT NULL DEFAULT '',
  `width` smallint(5) NOT NULL DEFAULT '0',
  `height` smallint(5) NOT NULL DEFAULT '0',
  `size` int(11) NOT NULL DEFAULT '0',
  `up_time` int(10) unsigned NOT NULL DEFAULT '0',
  `enabled` tinyint(3) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`affix_id`),
  KEY `ctype` (`ctype`),
  KEY `cid` (`cid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_agency
#

DROP TABLE IF EXISTS `open_agency`;
CREATE TABLE `open_agency` (
  `agency_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `agency_name` varchar(255) NOT NULL,
  `agency_desc` text NOT NULL,
  PRIMARY KEY (`agency_id`),
  KEY `agency_name` (`agency_name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_agent_auth
#

DROP TABLE IF EXISTS `open_agent_auth`;
CREATE TABLE `open_agent_auth` (
  `auth_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `start_time` int(10) unsigned NOT NULL,
  `end_time` int(10) unsigned NOT NULL,
  `act_range` tinyint(3) unsigned NOT NULL,
  `act_range_ext` varchar(255) NOT NULL,
  `act_type` tinyint(3) unsigned NOT NULL,
  `act_type_ext` tinytext NOT NULL,
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`auth_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_agent_booking
#

DROP TABLE IF EXISTS `open_agent_booking`;
CREATE TABLE `open_agent_booking` (
  `booking_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `agent_title` varchar(255) NOT NULL DEFAULT '',
  `start_time` int(10) unsigned NOT NULL,
  `end_time` int(10) unsigned NOT NULL,
  `agent_desc` tinytext NOT NULL,
  PRIMARY KEY (`booking_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

#
# Source for table open_agent_booking_goods
#

DROP TABLE IF EXISTS `open_agent_booking_goods`;
CREATE TABLE `open_agent_booking_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `booking_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_name` varchar(120) NOT NULL DEFAULT '',
  `goods_sn` varchar(60) NOT NULL DEFAULT '',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '1',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `goods_attr` text NOT NULL,
  `color_id` smallint(6) DEFAULT '0',
  `size_id` smallint(6) DEFAULT '0',
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`rec_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_agent_booking_info
#

DROP TABLE IF EXISTS `open_agent_booking_info`;
CREATE TABLE `open_agent_booking_info` (
  `booking_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `client_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `postscript` varchar(255) NOT NULL DEFAULT '',
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`booking_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_agent_client
#

DROP TABLE IF EXISTS `open_agent_client`;
CREATE TABLE `open_agent_client` (
  `client_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `address_name` varchar(50) NOT NULL DEFAULT '',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `consignee` varchar(60) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `country` smallint(5) NOT NULL DEFAULT '0',
  `province` smallint(5) NOT NULL DEFAULT '0',
  `city` smallint(5) NOT NULL DEFAULT '0',
  `district` smallint(5) NOT NULL DEFAULT '0',
  `address` varchar(120) NOT NULL DEFAULT '',
  `zipcode` varchar(60) NOT NULL DEFAULT '',
  `tel` varchar(60) NOT NULL DEFAULT '',
  `mobile` varchar(60) NOT NULL DEFAULT '',
  `sign_building` varchar(120) NOT NULL DEFAULT '',
  `best_time` varchar(120) NOT NULL DEFAULT '',
  PRIMARY KEY (`client_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_area_region
#

DROP TABLE IF EXISTS `open_area_region`;
CREATE TABLE `open_area_region` (
  `shipping_area_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `region_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`shipping_area_id`,`region_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_article
#

DROP TABLE IF EXISTS `open_article`;
CREATE TABLE `open_article` (
  `article_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` smallint(5) NOT NULL DEFAULT '0',
  `title` varchar(150) NOT NULL DEFAULT '',
  `content` longtext NOT NULL,
  `author` varchar(30) NOT NULL DEFAULT '',
  `author_email` varchar(60) NOT NULL DEFAULT '',
  `keywords` varchar(255) NOT NULL DEFAULT '',
  `article_type` tinyint(1) unsigned NOT NULL DEFAULT '2',
  `is_open` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `file_url` varchar(255) NOT NULL DEFAULT '',
  `open_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `link` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`article_id`),
  KEY `cat_id` (`cat_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_article_cat
#

DROP TABLE IF EXISTS `open_article_cat`;
CREATE TABLE `open_article_cat` (
  `cat_id` smallint(5) NOT NULL AUTO_INCREMENT,
  `cat_name` varchar(255) NOT NULL DEFAULT '',
  `cat_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `keywords` varchar(255) NOT NULL DEFAULT '',
  `cat_desc` varchar(255) NOT NULL DEFAULT '',
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `show_in_nav` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`cat_id`),
  KEY `cat_type` (`cat_type`),
  KEY `sort_order` (`sort_order`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_attribute
#

DROP TABLE IF EXISTS `open_attribute`;
CREATE TABLE `open_attribute` (
  `attr_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `attr_name` varchar(60) NOT NULL DEFAULT '',
  `attr_input_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `attr_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `attr_values` text NOT NULL,
  `attr_index` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_linked` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `attr_group` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_filter` tinyint(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`attr_id`),
  KEY `cat_id` (`cat_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_auction_log
#

DROP TABLE IF EXISTS `open_auction_log`;
CREATE TABLE `open_auction_log` (
  `log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `act_id` mediumint(8) unsigned NOT NULL,
  `bid_user` mediumint(8) unsigned NOT NULL,
  `bid_price` decimal(10,2) unsigned NOT NULL,
  `bid_time` int(10) unsigned NOT NULL,
  PRIMARY KEY (`log_id`),
  KEY `act_id` (`act_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_auto_manage
#

DROP TABLE IF EXISTS `open_auto_manage`;
CREATE TABLE `open_auto_manage` (
  `item_id` mediumint(8) NOT NULL,
  `type` varchar(10) NOT NULL,
  `starttime` int(10) NOT NULL,
  `endtime` int(10) NOT NULL,
  PRIMARY KEY (`item_id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_bonus_type
#

DROP TABLE IF EXISTS `open_bonus_type`;
CREATE TABLE `open_bonus_type` (
  `type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `type_name` varchar(60) NOT NULL DEFAULT '',
  `type_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `send_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `min_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `max_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `send_start_date` int(11) NOT NULL DEFAULT '0',
  `send_end_date` int(11) NOT NULL DEFAULT '0',
  `use_start_date` int(11) NOT NULL DEFAULT '0',
  `use_end_date` int(11) NOT NULL DEFAULT '0',
  `min_goods_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_booking_goods
#

DROP TABLE IF EXISTS `open_booking_goods`;
CREATE TABLE `open_booking_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `email` varchar(60) NOT NULL DEFAULT '',
  `link_man` varchar(60) NOT NULL DEFAULT '',
  `tel` varchar(60) NOT NULL DEFAULT '',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_desc` varchar(255) NOT NULL DEFAULT '',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `booking_time` int(10) unsigned NOT NULL DEFAULT '0',
  `is_dispose` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `dispose_user` varchar(30) NOT NULL DEFAULT '',
  `dispose_time` int(10) unsigned NOT NULL DEFAULT '0',
  `dispose_note` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`rec_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_brand
#

DROP TABLE IF EXISTS `open_brand`;
CREATE TABLE `open_brand` (
  `brand_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `brand_name` varchar(60) NOT NULL DEFAULT '',
  `brand_logo` varchar(80) NOT NULL DEFAULT '',
  `brand_desc` text NOT NULL,
  `site_url` varchar(255) NOT NULL DEFAULT '',
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`brand_id`),
  KEY `is_show` (`is_show`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_buyer_show
#

DROP TABLE IF EXISTS `open_buyer_show`;
CREATE TABLE `open_buyer_show` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `user_id` varchar(30) NOT NULL DEFAULT '',
  `img_path` varchar(255) NOT NULL DEFAULT '',
  `store_dir` varchar(255) NOT NULL DEFAULT '',
  `ip_address` varchar(15) DEFAULT '',
  `type` varchar(10) NOT NULL DEFAULT '',
  `upload_time` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_call_interact
#

DROP TABLE IF EXISTS `open_call_interact`;
CREATE TABLE `open_call_interact` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `call_record_id` int(8) DEFAULT NULL,
  `question` varchar(60) DEFAULT NULL,
  `answer` varchar(60) DEFAULT NULL,
  `act_staff` varchar(30) DEFAULT '',
  `in_use` tinyint(4) DEFAULT NULL,
  `add_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `call_record_id` (`call_record_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_call_record
#

DROP TABLE IF EXISTS `open_call_record`;
CREATE TABLE `open_call_record` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) DEFAULT NULL,
  `nick_name` varchar(60) DEFAULT NULL,
  `user_name` varchar(60) DEFAULT NULL,
  `email` varchar(60) DEFAULT NULL,
  `record_time` int(10) DEFAULT NULL,
  `record_type` tinyint(4) DEFAULT NULL,
  `call_number` varchar(30) DEFAULT NULL,
  `seat_number` varchar(30) DEFAULT NULL,
  `phone_number` varchar(30) DEFAULT NULL,
  `cell_number` varchar(30) DEFAULT NULL,
  `act_staff` varchar(30) DEFAULT NULL,
  `address` varchar(60) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `record_type` (`record_type`),
  KEY `phone_number` (`phone_number`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_card
#

DROP TABLE IF EXISTS `open_card`;
CREATE TABLE `open_card` (
  `card_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `card_name` varchar(120) NOT NULL DEFAULT '',
  `card_img` varchar(255) NOT NULL DEFAULT '',
  `card_fee` decimal(6,2) unsigned NOT NULL DEFAULT '0.00',
  `free_money` decimal(6,2) unsigned NOT NULL DEFAULT '0.00',
  `card_desc` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`card_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_cart
#

DROP TABLE IF EXISTS `open_cart`;
CREATE TABLE `open_cart` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `session_id` char(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_sn` varchar(60) NOT NULL DEFAULT '',
  `goods_name` varchar(120) NOT NULL DEFAULT '',
  `market_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_attr` text NOT NULL,
  `is_real` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `extension_code` varchar(30) NOT NULL DEFAULT '',
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `rec_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_gift` smallint(5) unsigned NOT NULL DEFAULT '0',
  `can_handsel` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `goods_attr_id` mediumint(8) NOT NULL,
  `color_id` smallint(6) DEFAULT NULL,
  `size_id` smallint(6) DEFAULT NULL,
  PRIMARY KEY (`rec_id`),
  KEY `session_id` (`session_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_cat_recommend
#

DROP TABLE IF EXISTS `open_cat_recommend`;
CREATE TABLE `open_cat_recommend` (
  `cat_id` smallint(5) NOT NULL,
  `recommend_type` tinyint(1) NOT NULL,
  PRIMARY KEY (`cat_id`,`recommend_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_catalog
#

DROP TABLE IF EXISTS `open_catalog`;
CREATE TABLE `open_catalog` (
  `catalog_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `catalog_sn` varchar(60) NOT NULL DEFAULT '',
  `catalog_name` varchar(255) NOT NULL DEFAULT '',
  `catalog_alias` varchar(255) NOT NULL DEFAULT '',
  `start_time` int(10) unsigned NOT NULL,
  `end_time` int(10) unsigned NOT NULL,
  `catalog_desc` text NOT NULL,
  `catalog_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`catalog_id`),
  UNIQUE KEY `catalog_sn` (`catalog_sn`),
  KEY `catalog_status` (`catalog_status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_catalog_p_no_goods
#

DROP TABLE IF EXISTS `open_catalog_p_no_goods`;
CREATE TABLE `open_catalog_p_no_goods` (
  `catalog_id` int(10) unsigned NOT NULL DEFAULT '0',
  `catalog_p_no` smallint(2) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`catalog_id`,`catalog_p_no`,`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_catalog_page_no
#

DROP TABLE IF EXISTS `open_catalog_page_no`;
CREATE TABLE `open_catalog_page_no` (
  `catalog_id` int(10) unsigned NOT NULL DEFAULT '0',
  `catalog_p_no` smallint(2) unsigned NOT NULL DEFAULT '0',
  `intro` text NOT NULL,
  KEY `catalog_p_no` (`catalog_id`,`catalog_p_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_catalog_send
#

DROP TABLE IF EXISTS `open_catalog_send`;
CREATE TABLE `open_catalog_send` (
  `send_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `catalog_id` int(10) unsigned NOT NULL DEFAULT '0',
  `user_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `send_status` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `operate_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`send_id`),
  KEY `catalog_id` (`catalog_id`),
  KEY `user_id` (`user_id`),
  KEY `send_status` (`send_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_category
#

DROP TABLE IF EXISTS `open_category`;
CREATE TABLE `open_category` (
  `cat_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `cat_name` varchar(90) NOT NULL DEFAULT '',
  `keywords` varchar(255) NOT NULL DEFAULT '',
  `cat_desc` varchar(255) NOT NULL DEFAULT '',
  `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `sort_order` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `template_file` varchar(50) NOT NULL DEFAULT '',
  `measure_unit` varchar(15) NOT NULL DEFAULT '',
  `show_in_nav` tinyint(1) NOT NULL DEFAULT '0',
  `style` varchar(150) NOT NULL,
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `grade` tinyint(4) NOT NULL DEFAULT '0',
  `filter_attr` smallint(6) NOT NULL DEFAULT '0',
  `goods_type` smallint(5) DEFAULT NULL,
  PRIMARY KEY (`cat_id`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_category_color
#

DROP TABLE IF EXISTS `open_category_color`;
CREATE TABLE `open_category_color` (
  `cat_color_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `color_name` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`cat_color_id`),
  KEY `cat_id` (`cat_id`),
  KEY `color_id` (`color_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_category_size
#

DROP TABLE IF EXISTS `open_category_size`;
CREATE TABLE `open_category_size` (
  `cat_size_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_name` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`cat_size_id`),
  KEY `cat_id` (`cat_id`),
  KEY `size_id` (`size_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_collect_goods
#

DROP TABLE IF EXISTS `open_collect_goods`;
CREATE TABLE `open_collect_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  `is_attention` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`rec_id`),
  KEY `user_id` (`user_id`),
  KEY `goods_id` (`goods_id`),
  KEY `is_attention` (`is_attention`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_color
#

DROP TABLE IF EXISTS `open_color`;
CREATE TABLE `open_color` (
  `color_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `color_code` varchar(20) NOT NULL DEFAULT '',
  `color_name` varchar(50) NOT NULL DEFAULT '',
  `color_note` varchar(255) NOT NULL DEFAULT '',
  `img_file`   varchar(255) NOT NULL default '',
  `img_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`color_id`),
  UNIQUE KEY `color_code` (`color_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_color_lib
#

DROP TABLE IF EXISTS `open_color_lib`;
CREATE TABLE `open_color_lib` (
  `img_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `img_name` varchar(50) NOT NULL DEFAULT '',
  `img_code` varchar(20) NOT NULL DEFAULT '',
  `img_file` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`img_id`),
  UNIQUE KEY `img_code` (`img_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_comment
#

DROP TABLE IF EXISTS `open_comment`;
CREATE TABLE `open_comment` (
  `comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `comment_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `id_value` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `title` varchar(60) NOT NULL DEFAULT '',
  `user_name` varchar(60) NOT NULL DEFAULT '',
  `content` text NOT NULL,
  `comment_rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `total_rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `layout_rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `comfort_rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `ip_address` varchar(15) NOT NULL DEFAULT '',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `parent_id` int(10) unsigned NOT NULL DEFAULT '0',
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`comment_id`),
  KEY `parent_id` (`parent_id`),
  KEY `id_value` (`id_value`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_crons
#

DROP TABLE IF EXISTS `open_crons`;
CREATE TABLE `open_crons` (
  `cron_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `cron_code` varchar(20) NOT NULL,
  `cron_name` varchar(120) NOT NULL,
  `cron_desc` text,
  `cron_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `cron_config` text NOT NULL,
  `thistime` int(10) NOT NULL DEFAULT '0',
  `nextime` int(10) NOT NULL,
  `day` tinyint(2) NOT NULL,
  `week` varchar(1) NOT NULL,
  `hour` varchar(2) NOT NULL,
  `minute` varchar(255) NOT NULL,
  `enable` tinyint(1) NOT NULL DEFAULT '1',
  `run_once` tinyint(1) NOT NULL DEFAULT '0',
  `allow_ip` varchar(100) NOT NULL DEFAULT '',
  `alow_files` varchar(255) NOT NULL,
  PRIMARY KEY (`cron_id`),
  KEY `nextime` (`nextime`),
  KEY `enable` (`enable`),
  KEY `cron_code` (`cron_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_delivery_station
#

DROP TABLE IF EXISTS `open_delivery_station`;
CREATE TABLE `open_delivery_station` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `region_id` smallint(5) NOT NULL,
  `station_admin_id` varchar(60) NOT NULL,
  `station_name` varchar(60) NOT NULL,
  `station_address` varchar(60) NOT NULL,
  `in_use` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_di_goods_spkcb
#

DROP TABLE IF EXISTS `open_di_goods_spkcb`;
CREATE TABLE `open_di_goods_spkcb` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `SPDM` varchar(255) DEFAULT NULL,
  `GG1DM` varchar(255) DEFAULT NULL,
  `GG2DM` varchar(255) DEFAULT NULL,
  `SL` varchar(255) DEFAULT NULL,
  `SL1` varchar(255) DEFAULT NULL,
  `SL2` varchar(255) DEFAULT NULL,
  `goods_id` varchar(255) DEFAULT NULL,
  `size_id` varchar(255) DEFAULT NULL,
  `color_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_dynamic
#

DROP TABLE IF EXISTS `open_dynamic`;
CREATE TABLE `open_dynamic` (
  `dy_id` int(11) NOT NULL AUTO_INCREMENT,
  `dy_Localstation` varchar(40) DEFAULT NULL,
  `dy_Project` varchar(20) DEFAULT NULL,
  `dy_Type` int(11) DEFAULT NULL,
  `dy_PPath1` varchar(150) DEFAULT NULL,
  `dy_PCUrl1` varchar(150) DEFAULT NULL,
  `dy_PPath2` varchar(150) DEFAULT NULL,
  `dy_PCUrl2` varchar(150) DEFAULT NULL,
  `dy_Text1` varchar(100) DEFAULT NULL,
  `dy_TextCUrl1` varchar(255) DEFAULT NULL,
  `dy_Text2` varchar(100) DEFAULT NULL,
  `dy_TextCUrl2` varchar(255) DEFAULT NULL,
  `dy_Text3` varchar(100) DEFAULT NULL,
  `dy_TextCUrl3` varchar(255) DEFAULT NULL,
  `dy_Text4` varchar(100) DEFAULT NULL,
  `dy_TextCUrl4` varchar(255) DEFAULT NULL,
  `dy_Text5` varchar(100) DEFAULT NULL,
  `dy_TextCUrl5` varchar(255) DEFAULT NULL,
  `dy_Text6` varchar(255) DEFAULT NULL,
  `dy_TextCUrl6` varchar(255) DEFAULT NULL,
  `dy_FPath` varchar(255) DEFAULT NULL,
  `dy_Html` varchar(5000) DEFAULT NULL,
  `dy_Sort` int(11) DEFAULT NULL,
  PRIMARY KEY (`dy_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_email_list
#

DROP TABLE IF EXISTS `open_email_list`;
CREATE TABLE `open_email_list` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `email` varchar(60) NOT NULL,
  `stat` tinyint(1) NOT NULL DEFAULT '0',
  `hash` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_email_sendlist
#

DROP TABLE IF EXISTS `open_email_sendlist`;
CREATE TABLE `open_email_sendlist` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `email` varchar(100) NOT NULL,
  `template_id` mediumint(8) NOT NULL,
  `email_content` text NOT NULL,
  `error` tinyint(1) NOT NULL DEFAULT '0',
  `pri` tinyint(10) NOT NULL,
  `last_send` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_error_log
#

DROP TABLE IF EXISTS `open_error_log`;
CREATE TABLE `open_error_log` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `info` varchar(255) NOT NULL,
  `file` varchar(100) NOT NULL,
  `time` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `time` (`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_exchange_goods
#

DROP TABLE IF EXISTS `open_exchange_goods`;
CREATE TABLE `open_exchange_goods` (
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `exchange_price` decimal(10,2) unsigned DEFAULT NULL,
  `exchange_integral` int(10) unsigned NOT NULL DEFAULT '0',
  `is_exchange` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_hot` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `user_rank` varchar(100) DEFAULT NULL,
  `is_stop` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_favourable_activity
#

DROP TABLE IF EXISTS `open_favourable_activity`;
CREATE TABLE `open_favourable_activity` (
  `act_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `act_name` varchar(255) NOT NULL,
  `start_time` int(10) unsigned NOT NULL,
  `end_time` int(10) unsigned NOT NULL,
  `user_rank` varchar(255) NOT NULL,
  `act_range` tinyint(3) unsigned NOT NULL,
  `act_range_ext` varchar(255) NOT NULL,
  `min_amount` decimal(10,2) unsigned NOT NULL,
  `max_amount` decimal(10,2) unsigned NOT NULL,
  `act_type` tinyint(3) unsigned NOT NULL,
  `act_type_ext` decimal(10,2) unsigned NOT NULL,
  `act_type_count` tinyint(1) unsigned NOT NULL default 0,
  `gift` text NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`act_id`),
  KEY `act_name` (`act_name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_feedback
#

DROP TABLE IF EXISTS `open_feedback`;
CREATE TABLE `open_feedback` (
  `msg_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `user_name` varchar(60) NOT NULL DEFAULT '',
  `user_email` varchar(60) NOT NULL DEFAULT '',
  `msg_title` varchar(200) NOT NULL DEFAULT '',
  `msg_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `msg_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `msg_content` text NOT NULL,
  `msg_time` int(10) unsigned NOT NULL DEFAULT '0',
  `message_img` varchar(255) NOT NULL DEFAULT '0',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0',
  `msg_area` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`msg_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_friend_link
#

DROP TABLE IF EXISTS `open_friend_link`;
CREATE TABLE `open_friend_link` (
  `link_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `link_name` varchar(255) NOT NULL DEFAULT '',
  `link_url` varchar(255) NOT NULL DEFAULT '',
  `link_logo` varchar(255) NOT NULL DEFAULT '',
  `show_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`link_id`),
  KEY `show_order` (`show_order`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_goods
#

DROP TABLE IF EXISTS `open_goods`;
CREATE TABLE `open_goods` (
  `goods_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_lib_id` smallint(5) NOT NULL DEFAULT '0',
  `goods_sn` varchar(60) NOT NULL DEFAULT '',
  `goods_name` varchar(120) NOT NULL DEFAULT '',
  `goods_name_style` varchar(60) NOT NULL DEFAULT '+',
  `click_count` int(10) unsigned NOT NULL DEFAULT '0',
  `brand_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `provider_name` varchar(100) NOT NULL DEFAULT '',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_weight` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
  `market_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `shop_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `promote_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `promote_start_date` int(11) unsigned NOT NULL DEFAULT '0',
  `promote_end_date` int(11) unsigned NOT NULL DEFAULT '0',
  `warn_number` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `keywords` varchar(255) NOT NULL DEFAULT '',
  `goods_brief` varchar(255) NOT NULL DEFAULT '',
  `goods_desc` text NOT NULL,
  `goods_thumb` varchar(255) NOT NULL DEFAULT '',
  `goods_img` varchar(255) NOT NULL DEFAULT '',
  `original_img` varchar(255) NOT NULL DEFAULT '',
  `is_real` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `extension_code` varchar(30) NOT NULL DEFAULT '',
  `season_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `series_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `is_on_sale` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `is_alone_sale` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `integral` int(10) unsigned NOT NULL DEFAULT '0',
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `sort_order` smallint(4) unsigned NOT NULL DEFAULT '0',
  `is_delete` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_best` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_new` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_hot` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_promote` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `bonus_type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `last_update` int(10) unsigned NOT NULL DEFAULT '0',
  `goods_type` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seller_note` varchar(255) NOT NULL DEFAULT '',
  `give_integral` int(11) NOT NULL DEFAULT '-1',
  `rank_integral` int(11) NOT NULL DEFAULT '-1',
  `storage_location` varchar(60) NOT NULL DEFAULT '',
  `is_union` tinyint(3) unsigned DEFAULT '0',
  `sales_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`goods_id`),
  KEY `goods_sn` (`goods_sn`),
  KEY `cat_id` (`cat_id`),
  KEY `last_update` (`last_update`),
  KEY `brand_id` (`brand_id`),
  KEY `goods_weight` (`goods_weight`),
  KEY `promote_end_date` (`promote_end_date`),
  KEY `promote_start_date` (`promote_start_date`),
  KEY `goods_number` (`goods_number`),
  KEY `sort_order` (`sort_order`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


#
# Source for table open_goods_activity
#

DROP TABLE IF EXISTS `open_goods_activity`;
CREATE TABLE `open_goods_activity` (
  `act_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `act_name` varchar(255) NOT NULL,
  `act_desc` text NOT NULL,
  `act_type` tinyint(3) unsigned NOT NULL,
  `goods_id` mediumint(8) unsigned NOT NULL,
  `goods_name` varchar(255) NOT NULL,
  `start_time` int(10) unsigned NOT NULL,
  `end_time` int(10) unsigned NOT NULL,
  `is_finished` tinyint(3) unsigned NOT NULL,
  `ext_info` text NOT NULL,
  PRIMARY KEY (`act_id`),
  KEY `act_name` (`act_name`,`act_type`,`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_goods_article
#

DROP TABLE IF EXISTS `open_goods_article`;
CREATE TABLE `open_goods_article` (
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `article_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `admin_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`goods_id`,`article_id`,`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_goods_attr
#

DROP TABLE IF EXISTS `open_goods_attr`;
CREATE TABLE `open_goods_attr` (
  `goods_attr_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `attr_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `attr_value` text NOT NULL,
  `attr_price` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`goods_attr_id`),
  KEY `goods_id` (`goods_id`),
  KEY `attr_id` (`attr_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_goods_cat
#

DROP TABLE IF EXISTS `open_goods_cat`;
CREATE TABLE `open_goods_cat` (
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `cat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`goods_id`,`cat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_goods_color
#

DROP TABLE IF EXISTS `open_goods_color`;
CREATE TABLE `open_goods_color` (
  `goods_color_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_sn` varchar(255) DEFAULT NULL,
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `color_name` varchar(50) NOT NULL DEFAULT '',
  `adjust_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `img_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_code` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`goods_color_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `img_id` (`img_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_goods_gallery
#

DROP TABLE IF EXISTS `open_goods_gallery`;
CREATE TABLE `open_goods_gallery` (
  `img_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `img_url` varchar(255) NOT NULL DEFAULT '',
  `img_desc` varchar(255) NOT NULL DEFAULT '',
  `thumb_url` varchar(255) NOT NULL DEFAULT '',
  `img_original` varchar(255) NOT NULL DEFAULT '',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `sort_order` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`img_id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_goods_size
#

DROP TABLE IF EXISTS `open_goods_size`;
CREATE TABLE `open_goods_size` (
  `goods_size_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_name` varchar(50) NOT NULL DEFAULT '',
  `adjust_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_sn` varchar(255) DEFAULT NULL,
  `size_code` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`goods_size_id`),
  KEY `goods_id` (`goods_id`),
  KEY `size_id` (`size_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_suspend
#

DROP TABLE IF EXISTS `open_order_suspend`;
CREATE TABLE `open_order_suspend` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `relating_order_id` int(8) NOT NULL DEFAULT '0',
  `relating_order_sn` varchar(20) NOT NULL DEFAULT '0',
  `suspend_reason` varchar(20) NOT NULL DEFAULT '',
  `from_user` varchar(20) NOT NULL DEFAULT '0',
  `process_user` varchar(20) NOT NULL DEFAULT '0',
  `process_mode` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `process_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  `start_time` int(11) unsigned NOT NULL DEFAULT '0',
  `end_time` int(11) unsigned NOT NULL DEFAULT '0',
  `suspend_desc` varchar(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `rid` (`relating_order_id`),
  KEY `rsn` (`relating_order_sn`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_goods_type
#

DROP TABLE IF EXISTS `open_goods_type`;
CREATE TABLE `open_goods_type` (
  `cat_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `cat_name` varchar(60) NOT NULL DEFAULT '',
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `attr_group` varchar(255) NOT NULL,
  PRIMARY KEY (`cat_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_group_goods
#

DROP TABLE IF EXISTS `open_group_goods`;
CREATE TABLE `open_group_goods` (
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `admin_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`parent_id`,`goods_id`,`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_group_promotion
#

DROP TABLE IF EXISTS `open_group_promotion`;
CREATE TABLE `open_group_promotion` (
  `group_promotion_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `group_code` varchar(50) NOT NULL DEFAULT '',
  `group_name` varchar(50) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `price_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `discount` tinyint(3) NOT NULL DEFAULT '0',
  `start_time` int(11) unsigned NOT NULL DEFAULT '0',
  `end_time` int(11) unsigned NOT NULL DEFAULT '0',
  `user_rank` varchar(50) NOT NULL DEFAULT '0',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  `is_finished` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`group_promotion_id`,`group_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_group_promotion_gallery
#

DROP TABLE IF EXISTS `open_group_promotion_gallery`;
CREATE TABLE `open_group_promotion_gallery` (
  `img_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `group_promotion_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `img_url` varchar(255) NOT NULL DEFAULT '',
  `img_desc` varchar(255) NOT NULL DEFAULT '',
  `thumb_url` varchar(255) NOT NULL DEFAULT '',
  `img_original` varchar(255) NOT NULL DEFAULT '',
  `is_reveal` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`img_id`),
  KEY `group_promotion_id` (`group_promotion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_group_promotion_goods
#

DROP TABLE IF EXISTS `open_group_promotion_goods`;
CREATE TABLE `open_group_promotion_goods` (
  `promotion_goods_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `group_promotion_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `admin_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`promotion_goods_id`),
  KEY `group_promotion_id` (`group_promotion_id`),
  KEY `goods_type_id` (`goods_type_id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_group_promotion_goods_type
#

DROP TABLE IF EXISTS `open_group_promotion_goods_type`;
CREATE TABLE `open_group_promotion_goods_type` (
  `goods_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `group_promotion_id` int(11) unsigned NOT NULL DEFAULT '0',
  `goods_type_name` varchar(50) NOT NULL DEFAULT '',
  `goods_count` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `is_present` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `add_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`goods_type_id`),
  KEY `group_promotion_id` (`group_promotion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_integral_exchange
#

DROP TABLE IF EXISTS `open_integral_exchange`;
CREATE TABLE `open_integral_exchange` (
  `integral_exchange_id` int(11) NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL,
  `integral` int(10) DEFAULT NULL,
  `exchange_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `exchange_type` varchar(5) DEFAULT NULL,
  `start_time` int(10) unsigned NOT NULL,
  `end_time` int(10) unsigned NOT NULL,
  `user_rank` varchar(255) NOT NULL,
  PRIMARY KEY (`integral_exchange_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_keywords
#

DROP TABLE IF EXISTS `open_keywords`;
CREATE TABLE `open_keywords` (
  `date` date NOT NULL DEFAULT '0000-00-00',
  `searchengine` varchar(20) NOT NULL DEFAULT '',
  `keyword` varchar(90) NOT NULL DEFAULT '',
  `count` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`date`,`searchengine`,`keyword`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_link_goods
#

DROP TABLE IF EXISTS `open_link_goods`;
CREATE TABLE `open_link_goods` (
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `link_goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `is_double` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `admin_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`goods_id`,`link_goods_id`,`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_mail_templates
#

DROP TABLE IF EXISTS `open_mail_templates`;
CREATE TABLE `open_mail_templates` (
  `template_id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT,
  `template_code` varchar(30) NOT NULL DEFAULT '',
  `is_html` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `template_subject` varchar(200) NOT NULL DEFAULT '',
  `template_content` text NOT NULL,
  `last_modify` int(10) unsigned NOT NULL DEFAULT '0',
  `last_send` int(10) unsigned NOT NULL DEFAULT '0',
  `type` varchar(10) NOT NULL,
  PRIMARY KEY (`template_id`),
  UNIQUE KEY `template_code` (`template_code`),
  KEY `type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_member_price
#

DROP TABLE IF EXISTS `open_member_price`;
CREATE TABLE `open_member_price` (
  `price_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `user_rank` tinyint(3) NOT NULL DEFAULT '0',
  `user_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`price_id`),
  KEY `goods_id` (`goods_id`,`user_rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_nav
#

DROP TABLE IF EXISTS `open_nav`;
CREATE TABLE `open_nav` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `ctype` varchar(10) DEFAULT NULL,
  `cid` smallint(5) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `ifshow` tinyint(1) NOT NULL,
  `vieworder` tinyint(1) NOT NULL,
  `opennew` tinyint(1) NOT NULL,
  `url` varchar(255) NOT NULL,
  `type` varchar(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`),
  KEY `ifshow` (`ifshow`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_action
#

DROP TABLE IF EXISTS `open_order_action`;
CREATE TABLE `open_order_action` (
  `action_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `action_user` varchar(30) NOT NULL DEFAULT '',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `shipping_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `action_note` varchar(255) NOT NULL DEFAULT '',
  `log_time` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`action_id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_goods
#

DROP TABLE IF EXISTS `open_order_goods`;
CREATE TABLE `open_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_name` varchar(120) NOT NULL DEFAULT '',
  `goods_sn` varchar(60) NOT NULL DEFAULT '',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '1',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `goods_attr` text NOT NULL,
  `color_id` smallint(6) DEFAULT NULL,
  `size_id` smallint(6) DEFAULT NULL,
  `send_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `is_real` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `extension_code` varchar(30) NOT NULL DEFAULT '',
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `is_gift` smallint(5) unsigned NOT NULL DEFAULT '0',
  `is_rejected` tinyint(1) NOT NULL DEFAULT '0',
  `goods_barcode` varchar(30) NOT NULL DEFAULT '',
  PRIMARY KEY (`rec_id`),
  KEY `order_id` (`order_id`),
  KEY `goods_id` (`goods_id`),
  KEY `goods_order_id` (`goods_id`,`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_info
#

DROP TABLE IF EXISTS `open_order_info`;
CREATE TABLE `open_order_info` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(20) NOT NULL DEFAULT '',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `beneficiary_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `shipping_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `consignee` varchar(60) NOT NULL DEFAULT '',
  `country` smallint(5) unsigned NOT NULL DEFAULT '0',
  `province` smallint(5) unsigned NOT NULL DEFAULT '0',
  `city` smallint(5) unsigned NOT NULL DEFAULT '0',
  `district` smallint(5) unsigned NOT NULL DEFAULT '0',
  `address` varchar(255) NOT NULL DEFAULT '',
  `zipcode` varchar(60) NOT NULL DEFAULT '',
  `tel` varchar(60) NOT NULL DEFAULT '',
  `mobile` varchar(60) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `best_time` varchar(120) NOT NULL DEFAULT '',
  `sign_building` varchar(120) NOT NULL DEFAULT '',
  `postscript` varchar(255) NOT NULL DEFAULT '',
  `shipping_id` tinyint(3) NOT NULL DEFAULT '0',
  `shipping_name` varchar(120) NOT NULL DEFAULT '',
  `pay_id` tinyint(3) NOT NULL DEFAULT '0',
  `pay_name` varchar(120) NOT NULL DEFAULT '',
  `how_oos` varchar(120) NOT NULL DEFAULT '',
  `how_surplus` varchar(120) NOT NULL DEFAULT '',
  `pack_name` varchar(120) NOT NULL DEFAULT '',
  `card_name` varchar(120) NOT NULL DEFAULT '',
  `card_message` varchar(255) NOT NULL DEFAULT '',
  `inv_payee` varchar(120) NOT NULL DEFAULT '',
  `inv_content` varchar(120) NOT NULL DEFAULT '',
  `goods_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `shipping_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `insure_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `pay_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `pack_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `card_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `money_paid` decimal(10,2) NOT NULL DEFAULT '0.00',
  `surplus` decimal(10,2) NOT NULL DEFAULT '0.00',
  `integral` int(10) unsigned NOT NULL DEFAULT '0',
  `integral_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `bonus` decimal(10,2) NOT NULL DEFAULT '0.00',
  `order_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `from_ad` smallint(5) NOT NULL DEFAULT '0',
  `referer` varchar(255) NOT NULL DEFAULT '',
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `confirm_time` int(10) unsigned NOT NULL DEFAULT '0',
  `pay_time` int(10) unsigned NOT NULL DEFAULT '0',
  `shipping_time` int(10) unsigned NOT NULL DEFAULT '0',
  `pack_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `card_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `bonus_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `invoice_no` varchar(50) NOT NULL DEFAULT '',
  `extension_code` varchar(30) NOT NULL DEFAULT '',
  `extension_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `to_buyer` varchar(255) NOT NULL DEFAULT '',
  `pay_note` varchar(255) NOT NULL DEFAULT '',
  `agency_id` smallint(5) unsigned NOT NULL,
  `inv_type` varchar(60) NOT NULL,
  `tax` decimal(10,2) NOT NULL,
  `is_separate` tinyint(1) NOT NULL DEFAULT '0',
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) NOT NULL,
  `delivery_type` tinyint(1) NOT NULL DEFAULT '0',
  `outlet_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `invoice_status` tinyint(1) NOT NULL DEFAULT '0',
  `delivery_station_id` int(10) NOT NULL DEFAULT '0',
  `lock_status` int(11) NOT NULL DEFAULT '0',
  `rj` int(11) DEFAULT '0',
  `goods_count` int(11) DEFAULT '0',
  `order_from` tinyint(1)  DEFAULT '7',
  `process_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`),
  KEY `user_id` (`user_id`),
  KEY `order_status` (`order_status`),
  KEY `shipping_status` (`shipping_status`),
  KEY `pay_status` (`pay_status`),
  KEY `shipping_id` (`shipping_id`),
  KEY `pay_id` (`pay_id`),
  KEY `extension_code` (`extension_code`,`extension_id`),
  KEY `agency_id` (`agency_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_printlog
#

DROP TABLE IF EXISTS `open_order_printlog`;
CREATE TABLE `open_order_printlog` (
  `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `log_time` int(10) unsigned NOT NULL DEFAULT '0',
  `user_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `log_info` varchar(255) NOT NULL DEFAULT '',
  `ip_address` varchar(15) NOT NULL DEFAULT '',
  `print_type` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`log_id`),
  KEY `log_time` (`log_time`),
  KEY `user_id` (`user_id`),
  KEY `print_type` (`print_type`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_return
#

DROP TABLE IF EXISTS `open_order_return`;
CREATE TABLE `open_order_return` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `return_sn` varchar(20) NOT NULL DEFAULT '0',
  `relating_order_sn` varchar(20) NOT NULL DEFAULT '0',
  `return_order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `return_order_ispass` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `return_reason` smallint(5) unsigned NOT NULL DEFAULT '0',
  `return_pay` smallint(5) unsigned NOT NULL DEFAULT '0',
  `action_user` varchar(30) NOT NULL DEFAULT '0',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  `return_consignee` varchar(60) NOT NULL DEFAULT '0',
  `return_tel` varchar(60) NOT NULL DEFAULT '0',
  `return_mobile` varchar(60) NOT NULL DEFAULT '0',
  `return_email` varchar(60) NOT NULL DEFAULT '0',
  `return_address` varchar(255) NOT NULL DEFAULT '0',
  `return_zipcode` varchar(60) NOT NULL DEFAULT '0',
  `return_goods_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `return_total_fee` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `return_type` enum('1','2') NOT NULL default '1',
  `rj` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `name` (`return_sn`),
  KEY `type` (`return_order_status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_return_action
#

DROP TABLE IF EXISTS `open_order_return_action`;
CREATE TABLE `open_order_return_action` (
  `action_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_return_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `action_user` varchar(30) NOT NULL DEFAULT '',
  `order_return_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `action_note` varchar(255) NOT NULL DEFAULT '',
  `log_time` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`action_id`),
  KEY `order_id` (`order_return_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_order_return_goods
#

DROP TABLE IF EXISTS `open_order_return_goods`;
CREATE TABLE `open_order_return_goods` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `return_order_id` int(8) NOT NULL DEFAULT '0',
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_barcode` varchar(30) NOT NULL DEFAULT '',
  `goods_name` varchar(120) NOT NULL DEFAULT '',
  `goods_sn` varchar(60) NOT NULL DEFAULT '',
  `goods_return_number` smallint(5) NOT NULL DEFAULT '1',
  `goods_buy_number` smallint(5) unsigned NOT NULL DEFAULT '1',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `color_id` smallint(6) DEFAULT NULL,
  `size_id` smallint(6) DEFAULT NULL,
  `is_real` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `extension_code` varchar(30) NOT NULL DEFAULT '',
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `is_gift` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `return_sn` (`return_order_id`),
  KEY `order_id` (`order_id`),
  KEY `type` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_pack
#

DROP TABLE IF EXISTS `open_pack`;
CREATE TABLE `open_pack` (
  `pack_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `pack_name` varchar(120) NOT NULL DEFAULT '',
  `pack_img` varchar(255) NOT NULL DEFAULT '',
  `pack_fee` smallint(5) unsigned NOT NULL DEFAULT '0',
  `free_money` smallint(5) unsigned NOT NULL DEFAULT '0',
  `pack_desc` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`pack_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_package_goods
#

DROP TABLE IF EXISTS `open_package_goods`;
CREATE TABLE `open_package_goods` (
  `package_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '1',
  `admin_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`package_id`,`goods_id`,`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_pay_log
#

DROP TABLE IF EXISTS `open_pay_log`;
CREATE TABLE `open_pay_log` (
  `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL,
  `order_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_paid` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_payment
#

DROP TABLE IF EXISTS `open_payment`;
CREATE TABLE `open_payment` (
  `pay_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `pay_code` varchar(20) NOT NULL DEFAULT '',
  `pay_name` varchar(120) NOT NULL DEFAULT '',
  `pay_fee` varchar(10) NOT NULL DEFAULT '0',
  `pay_desc` text NOT NULL,
  `pay_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `pay_config` text NOT NULL,
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_cod` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_online` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`pay_id`),
  UNIQUE KEY `pay_code` (`pay_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_pk_log
#

DROP TABLE IF EXISTS `open_pk_log`;
CREATE TABLE `open_pk_log` (
  `pk_from` varchar(100) NOT NULL DEFAULT '',
  `pk_id` mediumint(8) unsigned NOT NULL,
  PRIMARY KEY (`pk_from`,`pk_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_plugins
#

DROP TABLE IF EXISTS `open_plugins`;
CREATE TABLE `open_plugins` (
  `code` varchar(30) NOT NULL DEFAULT '',
  `version` varchar(10) NOT NULL DEFAULT '',
  `library` varchar(255) NOT NULL DEFAULT '',
  `assign` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `install_date` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_region
#

DROP TABLE IF EXISTS `open_region`;
CREATE TABLE `open_region` (
  `region_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `region_name` varchar(120) NOT NULL DEFAULT '',
  `region_type` tinyint(1) NOT NULL DEFAULT '2',
  `agency_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`region_id`),
  KEY `parent_id` (`parent_id`),
  KEY `region_type` (`region_type`),
  KEY `agency_id` (`agency_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_return_set
#

DROP TABLE IF EXISTS `open_return_set`;
CREATE TABLE `open_return_set` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `type` smallint(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_roster
#

DROP TABLE IF EXISTS `open_roster`;
CREATE TABLE `open_roster` (
  `roster_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `consignee` varchar(60) NOT NULL DEFAULT '',
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `birthday` date NOT NULL DEFAULT '0000-00-00',
  `email` varchar(60) NOT NULL DEFAULT '',
  `reg_time` int(10) unsigned NOT NULL DEFAULT '0',
  `office_phone` varchar(20) NOT NULL,
  `home_phone` varchar(20) NOT NULL,
  `country` smallint(5) NOT NULL DEFAULT '0',
  `province` smallint(5) NOT NULL DEFAULT '0',
  `city` smallint(5) NOT NULL DEFAULT '0',
  `district` smallint(5) NOT NULL DEFAULT '0',
  `address` varchar(120) NOT NULL DEFAULT '',
  `zipcode` varchar(60) NOT NULL DEFAULT '',
  `mobile` varchar(60) NOT NULL DEFAULT '',
  `sign_building` varchar(120) NOT NULL DEFAULT '',
  `best_time` varchar(120) NOT NULL DEFAULT '',
  PRIMARY KEY (`roster_id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_searchengine
#

DROP TABLE IF EXISTS `open_searchengine`;
CREATE TABLE `open_searchengine` (
  `date` date NOT NULL DEFAULT '0000-00-00',
  `searchengine` varchar(20) NOT NULL DEFAULT '',
  `count` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`date`,`searchengine`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_season
#

DROP TABLE IF EXISTS `open_season`;
CREATE TABLE `open_season` (
  `season_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `season_code` varchar(20) NOT NULL,
  `season_name` varchar(50) NOT NULL DEFAULT '',
  `default_item` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`season_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_series
#

DROP TABLE IF EXISTS `open_series`;
CREATE TABLE `open_series` (
  `series_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `series_code` varchar(20) NOT NULL,
  `series_name` varchar(50) NOT NULL DEFAULT '',
  `default_item` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`series_id`)
) ENGINE=InnoDB   DEFAULT CHARSET=utf8;

#
# Source for table open_sessions
#

DROP TABLE IF EXISTS `open_sessions`;
CREATE TABLE `open_sessions` (
  `sesskey` char(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `expiry` int(10) unsigned NOT NULL DEFAULT '0',
  `userid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `adminid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `ip` char(15) NOT NULL DEFAULT '',
  `user_name` varchar(60) NOT NULL,
  `user_rank` tinyint(3) NOT NULL,
  `discount` decimal(3,2) NOT NULL,
  `email` varchar(60) NOT NULL,
  `data` char(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`sesskey`),
  KEY `expiry` (`expiry`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8;

#
# Source for table open_sessions_data
#

DROP TABLE IF EXISTS `open_sessions_data`;
CREATE TABLE `open_sessions_data` (
  `sesskey` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `expiry` int(10) unsigned NOT NULL DEFAULT '0',
  `data` longtext NOT NULL,
  PRIMARY KEY (`sesskey`),
  KEY `expiry` (`expiry`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_shipping
#

DROP TABLE IF EXISTS `open_shipping`;
CREATE TABLE `open_shipping` (
  `shipping_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `shipping_code` varchar(20) NOT NULL DEFAULT '',
  `shipping_name` varchar(120) NOT NULL DEFAULT '',
  `shipping_desc` varchar(255) NOT NULL DEFAULT '',
  `insure` varchar(10) NOT NULL DEFAULT '0',
  `support_cod` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `shipping_print` text NOT NULL,
  `shipping_print2` text,
  `is_receive_print` tinyint(1) NOT NULL DEFAULT '0',  
  PRIMARY KEY (`shipping_id`),
  KEY `shipping_code` (`shipping_code`,`enabled`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_shipping_area
#

DROP TABLE IF EXISTS `open_shipping_area`;
CREATE TABLE `open_shipping_area` (
  `shipping_area_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `shipping_area_name` varchar(150) NOT NULL DEFAULT '',
  `shipping_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `configure` text NOT NULL,
  PRIMARY KEY (`shipping_area_id`),
  KEY `shipping_id` (`shipping_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_shop_config
#

DROP TABLE IF EXISTS `open_shop_config`;
CREATE TABLE `open_shop_config` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `code` varchar(30) NOT NULL DEFAULT '',
  `type` varchar(10) NOT NULL DEFAULT '',
  `store_range` varchar(255) NOT NULL DEFAULT '',
  `store_dir` varchar(255) NOT NULL DEFAULT '',
  `value` text NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_size
#

DROP TABLE IF EXISTS `open_size`;
CREATE TABLE `open_size` (
  `size_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `size_code` varchar(20) NOT NULL DEFAULT '',
  `size_name` varchar(50) NOT NULL DEFAULT '',
  `size_note` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`size_id`),
  UNIQUE KEY `size_code` (`size_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_size_lib
#

DROP TABLE IF EXISTS `open_size_lib`;
CREATE TABLE `open_size_lib` (
  `lib_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` smallint(5) NOT NULL DEFAULT '0',
  `lib_name` varchar(50) NOT NULL DEFAULT '',
  `lib_desc` text NOT NULL,
  `is_define` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `site_url` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`lib_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_sms_buildin_info
#

DROP TABLE IF EXISTS `open_sms_buildin_info`;
CREATE TABLE `open_sms_buildin_info` (
  `info_id` int(11) NOT NULL AUTO_INCREMENT,
  `info_content` varchar(255) DEFAULT NULL,
  `info_type` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `create_time` int(10) unsigned NOT NULL DEFAULT '0',
  `is_display` tinyint(3) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`info_id`),
  KEY `info_type` (`info_type`),
  KEY `is_display` (`is_display`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_snatch_log
#

DROP TABLE IF EXISTS `open_snatch_log`;
CREATE TABLE `open_snatch_log` (
  `log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `snatch_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `bid_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `bid_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`log_id`),
  KEY `snatch_id` (`snatch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_stats
#

DROP TABLE IF EXISTS `open_stats`;
CREATE TABLE `open_stats` (
  `access_time` int(10) unsigned NOT NULL DEFAULT '0',
  `ip_address` varchar(15) NOT NULL DEFAULT '',
  `visit_times` smallint(5) unsigned NOT NULL DEFAULT '1',
  `browser` varchar(60) NOT NULL DEFAULT '',
  `system` varchar(20) NOT NULL DEFAULT '',
  `language` varchar(20) NOT NULL DEFAULT '',
  `area` varchar(30) NOT NULL DEFAULT '',
  `referer_domain` varchar(100) NOT NULL DEFAULT '',
  `referer_path` varchar(200) NOT NULL DEFAULT '',
  `access_url` varchar(255) NOT NULL DEFAULT '',
  KEY `access_time` (`access_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_tag
#

DROP TABLE IF EXISTS `open_tag`;
CREATE TABLE `open_tag` (
  `tag_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `tag_words` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`tag_id`),
  KEY `user_id` (`user_id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_template
#

DROP TABLE IF EXISTS `open_template`;
CREATE TABLE `open_template` (
  `filename` varchar(30) NOT NULL DEFAULT '',
  `region` varchar(40) NOT NULL DEFAULT '',
  `library` varchar(40) NOT NULL DEFAULT '',
  `sort_order` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `number` tinyint(1) unsigned NOT NULL DEFAULT '5',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `theme` varchar(60) NOT NULL DEFAULT '',
  `remarks` varchar(30) NOT NULL DEFAULT '',
  KEY `filename` (`filename`,`region`),
  KEY `theme` (`theme`),
  KEY `remarks` (`remarks`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_tmdzb
#

DROP TABLE IF EXISTS `open_tmdzb`;
CREATE TABLE `open_tmdzb` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `SPTM` varchar(255) DEFAULT NULL,
  `SPDM` varchar(255) DEFAULT NULL,
  `GG1DM` varchar(255) DEFAULT NULL,
  `GG2DM` varchar(255) DEFAULT NULL,
  `LX` varchar(255) DEFAULT NULL,
  `XH` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_topic
#

DROP TABLE IF EXISTS `open_topic`;
CREATE TABLE `open_topic` (
  `topic_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '''''',
  `intro` text NOT NULL,
  `start_time` int(11) NOT NULL DEFAULT '0',
  `end_time` int(10) NOT NULL DEFAULT '0',
  `data` text NOT NULL,
  `template` varchar(255) NOT NULL DEFAULT '''''',
  `css` text NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`topic_id`),
  KEY `topic_id` (`topic_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_transport
#

DROP TABLE IF EXISTS `open_transport`;
CREATE TABLE `open_transport` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) DEFAULT NULL,
  `downId` int(11) DEFAULT NULL,
  `loadId` int(11) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  `downfrom` varchar(255) DEFAULT NULL,
  `act` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_account
#

DROP TABLE IF EXISTS `open_user_account`;
CREATE TABLE `open_user_account` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `admin_user` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `add_time` int(10) NOT NULL DEFAULT '0',
  `paid_time` int(10) NOT NULL DEFAULT '0',
  `admin_note` varchar(255) NOT NULL,
  `user_note` varchar(255) NOT NULL,
  `process_type` tinyint(1) NOT NULL DEFAULT '0',
  `payment` varchar(90) NOT NULL,
  `is_paid` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `is_paid` (`is_paid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_address
#

DROP TABLE IF EXISTS `open_user_address`;
CREATE TABLE `open_user_address` (
  `address_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `address_name` varchar(50) NOT NULL DEFAULT '',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `consignee` varchar(60) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `country` smallint(5) NOT NULL DEFAULT '0',
  `province` smallint(5) NOT NULL DEFAULT '0',
  `city` smallint(5) NOT NULL DEFAULT '0',
  `district` smallint(5) NOT NULL DEFAULT '0',
  `address` varchar(120) NOT NULL DEFAULT '',
  `zipcode` varchar(60) NOT NULL DEFAULT '',
  `tel` varchar(60) NOT NULL DEFAULT '',
  `mobile` varchar(60) NOT NULL DEFAULT '',
  `sign_building` varchar(120) NOT NULL DEFAULT '',
  `best_time` varchar(120) NOT NULL DEFAULT '',
  PRIMARY KEY (`address_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_attribute
#

DROP TABLE IF EXISTS `open_user_attribute`;
CREATE TABLE `open_user_attribute` (
  `attr_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `attr_name` varchar(60) NOT NULL DEFAULT '',
  `attr_input_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `attr_type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `attr_values` text NOT NULL,
  `attr_index` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_linked` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`attr_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_attribute_value
#

DROP TABLE IF EXISTS `open_user_attribute_value`;
CREATE TABLE `open_user_attribute_value` (
  `user_attr_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `attr_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `attr_value` text NOT NULL,
  PRIMARY KEY (`user_attr_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_bonus
#

DROP TABLE IF EXISTS `open_user_bonus`;
CREATE TABLE `open_user_bonus` (
  `bonus_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `bonus_type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `bonus_sn` bigint(20) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `used_time` int(10) unsigned NOT NULL DEFAULT '0',
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `emailed` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`bonus_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_feed
#

DROP TABLE IF EXISTS `open_user_feed`;
CREATE TABLE `open_user_feed` (
  `feed_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `value_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `feed_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_feed` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`feed_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_user_rank
#

DROP TABLE IF EXISTS `open_user_rank`;
CREATE TABLE `open_user_rank` (
  `rank_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `rank_name` varchar(30) NOT NULL DEFAULT '',
  `min_points` int(10) unsigned NOT NULL DEFAULT '0',
  `max_points` int(10) unsigned NOT NULL DEFAULT '0',
  `discount` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `show_price` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `special_rank` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`rank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_user_union
#

DROP TABLE IF EXISTS `open_user_union`;
CREATE TABLE `open_user_union` (
  `union_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `ctype` enum('union','agent') NOT NULL DEFAULT 'union',
  `reg_time` int(10) unsigned NOT NULL DEFAULT '0',
  `act_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `act_note` varchar(255) NOT NULL DEFAULT '',
  `log_time` int(10) unsigned NOT NULL DEFAULT '0',
  `admin_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`union_id`),
  UNIQUE KEY `ctype` (`ctype`,`user_id`),
  KEY `act_status` (`act_status`),
  KEY `admin_id` (`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_users
#

DROP TABLE IF EXISTS `open_users`;
CREATE TABLE `open_users` (
  `user_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `nick_name` varchar(60) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `user_name` varchar(60) NOT NULL DEFAULT '',
  `password` varchar(32) NOT NULL DEFAULT '',
  `question` varchar(255) NOT NULL DEFAULT '',
  `answer` varchar(255) NOT NULL DEFAULT '',
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `birthday` date NOT NULL DEFAULT '0000-00-00',
  `user_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `frozen_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `pay_points` int(10) unsigned NOT NULL DEFAULT '0',
  `rank_points` int(10) unsigned NOT NULL DEFAULT '0',
  `address_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `reg_time` int(10) unsigned NOT NULL DEFAULT '0',
  `last_login` int(11) unsigned NOT NULL DEFAULT '0',
  `last_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_ip` varchar(15) NOT NULL DEFAULT '',
  `visit_count` smallint(5) unsigned NOT NULL DEFAULT '0',
  `user_rank` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_special` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `union_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `agent_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `salt` varchar(10) NOT NULL DEFAULT '0',
  `parent_id` mediumint(9) NOT NULL DEFAULT '0',
  `flag` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `alias` varchar(60) NOT NULL,
  `msn` varchar(60) NOT NULL,
  `qq` varchar(20) NOT NULL,
  `office_phone` varchar(20) NOT NULL,
  `home_phone` varchar(20) NOT NULL,
  `mobile_phone` varchar(20) NOT NULL,
  `is_validated` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `credit_line` decimal(10,2) unsigned NOT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_name` (`user_name`),
  KEY `email` (`email`),
  KEY `parent_id` (`parent_id`),
  KEY `flag` (`flag`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_virtual_card
#

DROP TABLE IF EXISTS `open_virtual_card`;
CREATE TABLE `open_virtual_card` (
  `card_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `card_sn` varchar(60) NOT NULL DEFAULT '',
  `card_password` varchar(60) NOT NULL DEFAULT '',
  `add_date` int(11) NOT NULL DEFAULT '0',
  `end_date` int(11) NOT NULL DEFAULT '0',
  `is_saled` tinyint(1) NOT NULL DEFAULT '0',
  `order_sn` varchar(20) NOT NULL DEFAULT '',
  `crc32` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`card_id`),
  KEY `goods_id` (`goods_id`),
  KEY `car_sn` (`card_sn`),
  KEY `is_saled` (`is_saled`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_volume_price
#

DROP TABLE IF EXISTS `open_volume_price`;
CREATE TABLE `open_volume_price` (
  `price_type` tinyint(1) unsigned NOT NULL,
  `goods_id` mediumint(8) unsigned NOT NULL,
  `volume_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `volume_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`price_type`,`goods_id`,`volume_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_vote
#

DROP TABLE IF EXISTS `open_vote`;
CREATE TABLE `open_vote` (
  `vote_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `vote_name` varchar(250) NOT NULL DEFAULT '',
  `start_time` int(11) unsigned NOT NULL DEFAULT '0',
  `end_time` int(11) unsigned NOT NULL DEFAULT '0',
  `can_multi` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `vote_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`vote_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_vote_log
#

DROP TABLE IF EXISTS `open_vote_log`;
CREATE TABLE `open_vote_log` (
  `log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `vote_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `ip_address` varchar(15) NOT NULL DEFAULT '',
  `vote_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`log_id`),
  KEY `vote_id` (`vote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_vote_option
#

DROP TABLE IF EXISTS `open_vote_option`;
CREATE TABLE `open_vote_option` (
  `option_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `vote_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `option_name` varchar(250) NOT NULL DEFAULT '',
  `option_count` int(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`option_id`),
  KEY `vote_id` (`vote_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_wholesale
#

DROP TABLE IF EXISTS `open_wholesale`;
CREATE TABLE `open_wholesale` (
  `act_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `goods_id` mediumint(8) unsigned NOT NULL,
  `goods_name` varchar(255) NOT NULL,
  `rank_ids` varchar(255) NOT NULL,
  `prices` text NOT NULL,
  `enabled` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`act_id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_goods_inventory`;
CREATE TABLE `open_goods_inventory` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `goods_id` mediumint(8) unsigned NOT NULL default '0',
  `color_id` smallint(5) unsigned NOT NULL default '0',
  `size_id` smallint(5) unsigned NOT NULL default '0',
  `goods_number_actual` smallint(5) unsigned NOT NULL default '0',
  `goods_number_available` smallint(5) unsigned NOT NULL default '0' ,
  `goods_number_alert` smallint(5) unsigned NOT NULL default '0',
  `SPDM` varchar(255) NOT NULL default '0',
  `GG1DM` varchar(255) NOT NULL default '0',
  `GG2DM` varchar(255) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `goodid` (`goods_id`),
  KEY `colorid` (`color_id`),
  KEY `sizeid` (`size_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8

 
#
# Source for table open_tb_app
#

DROP TABLE IF EXISTS `open_tb_app`;
CREATE TABLE `open_tb_app` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `app_key` varchar(255) DEFAULT NULL,
  `app_secret` varchar(255) DEFAULT NULL,
  `app_session` varchar(255) DEFAULT NULL,
  `app_name` varchar(255) DEFAULT NULL,
  `shop_name` varchar(255) DEFAULT NULL,
  `nick` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `is_use` int(11) DEFAULT '0',
  `field1` varchar(255) DEFAULT NULL,
  `field2` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_area
#

DROP TABLE IF EXISTS `open_tb_area`;
CREATE TABLE `open_tb_area` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `area_id` varchar(255) DEFAULT NULL,
  `area_type` varchar(255) DEFAULT NULL,
  `area_name` varchar(255) DEFAULT NULL,
  `parent_id` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_brand
#

DROP TABLE IF EXISTS `open_tb_brand`;
CREATE TABLE `open_tb_brand` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `vid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `nick` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_guige1
#

DROP TABLE IF EXISTS `open_tb_guige1`;
CREATE TABLE `open_tb_guige1` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` varchar(255) DEFAULT NULL,
  `pid` varchar(255) DEFAULT NULL,
  `prop_name` varchar(255) DEFAULT NULL,
  `vid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `name_alias` varchar(255) DEFAULT NULL,
  `is_parent` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `sort_order` varchar(255) DEFAULT NULL,
  `color_code` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  `field2` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_guige2
#

DROP TABLE IF EXISTS `open_tb_guige2`;
CREATE TABLE `open_tb_guige2` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` varchar(255) DEFAULT NULL,
  `pid` varchar(255) DEFAULT NULL,
  `prop_name` varchar(255) DEFAULT NULL,
  `vid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `name_alias` varchar(255) DEFAULT NULL,
  `is_parent` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `sort_order` varchar(255) DEFAULT NULL,
  `size_code` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  `field2` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_item
#

DROP TABLE IF EXISTS `open_tb_item`;
CREATE TABLE `open_tb_item` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `iid` varchar(255) DEFAULT NULL,
  `detail_url` varchar(255) DEFAULT NULL,
  `num_iid` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `nick` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `cid` varchar(255) DEFAULT NULL,
  `seller_cids` varchar(255) DEFAULT NULL,
  `props` varchar(255) DEFAULT NULL,
  `input_pids` varchar(255) DEFAULT NULL,
  `input_str` varchar(255) DEFAULT NULL,
  `item_desc` text,
  `pic_path` varchar(255) DEFAULT NULL,
  `num` varchar(255) DEFAULT NULL,
  `valid_thru` varchar(255) DEFAULT NULL,
  `list_time` varchar(255) DEFAULT NULL,
  `stuff_status` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `price` varchar(255) DEFAULT NULL,
  `post_fee` varchar(255) DEFAULT NULL,
  `express_fee` varchar(255) DEFAULT NULL,
  `ems_fee` varchar(255) DEFAULT NULL,
  `has_discount` varchar(255) DEFAULT NULL,
  `freight_payer` varchar(255) DEFAULT NULL,
  `has_invoice` varchar(255) DEFAULT NULL,
  `has_warranty` varchar(255) DEFAULT NULL,
  `has_showcase` varchar(255) DEFAULT NULL,
  `modified` varchar(255) DEFAULT NULL,
  `increment` varchar(255) DEFAULT NULL,
  `auto_repost` varchar(255) DEFAULT NULL,
  `approve_status` varchar(255) DEFAULT NULL,
  `postage_id` varchar(255) DEFAULT NULL,
  `product_id` varchar(255) DEFAULT NULL,
  `auction_point` varchar(255) DEFAULT NULL,
  `property_alias` varchar(255) DEFAULT NULL,
  `outer_id` varchar(255) DEFAULT NULL,
  `is_virtural` varchar(255) DEFAULT NULL,
  `is_taobao` varchar(255) DEFAULT NULL,
  `is_ex` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_itemcat
#

DROP TABLE IF EXISTS `open_tb_itemcat`;
CREATE TABLE `open_tb_itemcat` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` varchar(255) DEFAULT NULL,
  `parent_cid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `is_parent` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `sort_order` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_itemimg
#

DROP TABLE IF EXISTS `open_tb_itemimg`;
CREATE TABLE `open_tb_itemimg` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `iid` varchar(50) DEFAULT NULL,
  `itemimg_id` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_itemprop
#

DROP TABLE IF EXISTS `open_tb_itemprop`;
CREATE TABLE `open_tb_itemprop` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `pid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `is_key_prop` varchar(255) DEFAULT NULL,
  `is_sale_prop` varchar(255) DEFAULT NULL,
  `is_color_prop` varchar(255) DEFAULT NULL,
  `is_enum_prop` varchar(255) DEFAULT NULL,
  `is_input_prop` varchar(255) DEFAULT NULL,
  `is_item_prop` varchar(255) DEFAULT NULL,
  `child_template` varchar(255) DEFAULT NULL,
  `must` varchar(255) DEFAULT NULL,
  `multi` varchar(255) DEFAULT NULL,
  `parent_pid` varchar(255) DEFAULT NULL,
  `parent_vid` varchar(255) DEFAULT NULL,
  `prop_values` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `sort_order` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_my_shipping
#

DROP TABLE IF EXISTS `open_tb_my_shipping`;
CREATE TABLE `open_tb_my_shipping` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` varchar(255) DEFAULT NULL,
  `seller_nick` varchar(255) DEFAULT NULL,
  `buyer_nick` varchar(255) DEFAULT NULL,
  `delivery_start` varchar(255) DEFAULT NULL,
  `delivery_end` varchar(255) DEFAULT NULL,
  `out_sid` varchar(255) DEFAULT NULL,
  `item_title` varchar(255) DEFAULT NULL,
  `receiver_name` varchar(255) DEFAULT NULL,
  `receiver_phone` varchar(255) DEFAULT NULL,
  `receiver_mobile` varchar(255) DEFAULT NULL,
  `receiver_location` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `freight_payer` varchar(255) DEFAULT NULL,
  `seller_confirm` varchar(255) DEFAULT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_postage
#

DROP TABLE IF EXISTS `open_tb_postage`;
CREATE TABLE `open_tb_postage` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `postage_id` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `memo` varchar(255) DEFAULT NULL,
  `created` varchar(255) DEFAULT NULL,
  `modified` varchar(255) DEFAULT NULL,
  `post_price` varchar(255) DEFAULT NULL,
  `post_increase` varchar(255) DEFAULT NULL,
  `express_price` varchar(255) DEFAULT NULL,
  `express_increase` varchar(255) DEFAULT NULL,
  `ems_price` varchar(255) DEFAULT NULL,
  `ems_increase` varchar(255) DEFAULT NULL,
  `postage_mode_list` varchar(255) DEFAULT NULL,
  `nick` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_postagemode
#

DROP TABLE IF EXISTS `open_tb_postagemode`;
CREATE TABLE `open_tb_postagemode` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `postage_ id` varchar(255) DEFAULT NULL,
  `postage_mode_id` varchar(255) DEFAULT NULL,
  `postage_mode_type` varchar(255) DEFAULT NULL,
  `dest` varchar(255) DEFAULT NULL,
  `price` varchar(255) DEFAULT NULL,
  `increase` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_tb_propimg
#

DROP TABLE IF EXISTS `open_tb_propimg`;
CREATE TABLE `open_tb_propimg` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `iid` varchar(50) DEFAULT NULL,
  `propimg_id` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `properties` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_propvalue
#

DROP TABLE IF EXISTS `open_tb_propvalue`;
CREATE TABLE `open_tb_propvalue` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` varchar(255) DEFAULT NULL,
  `pid` varchar(255) DEFAULT NULL,
  `prop_name` varchar(255) DEFAULT NULL,
  `vid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `name_alias` varchar(255) DEFAULT NULL,
  `is_parent` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `sort_order` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_sellerauthorize
#

DROP TABLE IF EXISTS `open_tb_sellerauthorize`;
CREATE TABLE `open_tb_sellerauthorize` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `item_cats` varchar(255) DEFAULT NULL,
  `brands` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_tb_sellercat
#

DROP TABLE IF EXISTS `open_tb_sellercat`;
CREATE TABLE `open_tb_sellercat` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` varchar(255) DEFAULT NULL,
  `parent_cid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `pict_url` varchar(255) DEFAULT NULL,
  `sort_order` varchar(255) DEFAULT NULL,
  `nick` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_shipping
#

DROP TABLE IF EXISTS `open_tb_shipping`;
CREATE TABLE `open_tb_shipping` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` varchar(255) DEFAULT NULL,
  `company_code` varchar(255) DEFAULT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `field1` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_shop
#

DROP TABLE IF EXISTS `open_tb_shop`;
CREATE TABLE `open_tb_shop` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `sid` varchar(255) DEFAULT NULL,
  `cid` varchar(255) DEFAULT NULL,
  `nick` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `desc` varchar(255) DEFAULT NULL,
  `bulletin` varchar(255) DEFAULT NULL,
  `pic_path` varchar(255) DEFAULT NULL,
  `created` varchar(255) DEFAULT NULL,
  `modified` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_shopcat
#

DROP TABLE IF EXISTS `open_tb_shopcat`;
CREATE TABLE `open_tb_shopcat` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` varchar(255) DEFAULT NULL,
  `parent_cid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `is_parent` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_tb_sku
#

DROP TABLE IF EXISTS `open_tb_sku`;
CREATE TABLE `open_tb_sku` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `sku_id` varchar(255) DEFAULT NULL ,
  `iid` varchar(255) DEFAULT NULL ,
  `properties` varchar(255) DEFAULT NULL ,
  `quantity` varchar(255) DEFAULT NULL ,
  `price` varchar(255) DEFAULT NULL ,
  `outer_id` varchar(255) DEFAULT NULL,
  `created` varchar(255) DEFAULT NULL ,
  `modified` varchar(255) DEFAULT NULL ,
  `status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_tb_video
#

DROP TABLE IF EXISTS `open_tb_video`;
CREATE TABLE `open_tb_video` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `iid` varchar(255) DEFAULT NULL,
  `video_id` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `modified` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Source for table open_suspend_reason
#

DROP TABLE IF EXISTS `open_suspend_reason`;
CREATE TABLE `open_suspend_reason` (
  `reason_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `reason_code` varchar(20) NOT NULL,
  `reason_name` varchar(50) NOT NULL DEFAULT '',
  `reason_desc` varchar(200) NOT NULL DEFAULT '',
  `reason_type` tinyint(3) unsigned NOT NULL DEFAULT '0',  
  PRIMARY KEY (`reason_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_tb_config`;
CREATE TABLE `open_tb_config` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `code` varchar(30) NOT NULL DEFAULT '',
  `type` varchar(10) NOT NULL DEFAULT '',
  `store_range` varchar(255) NOT NULL DEFAULT '',
  `store_dir` varchar(255) NOT NULL DEFAULT '',
  `value` text NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_purchase_balance_order`;
CREATE TABLE `open_purchase_balance_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `supplier_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `deliver_time` int(10) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `pay_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `surplus_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `pay_type` smallint(5) unsigned NOT NULL DEFAULT '0',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `balance_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_purchase_balance_order_detail`;
CREATE TABLE `open_purchase_balance_order_detail` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `order_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `associate_time` int(10) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `payed_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `pay_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `surplus_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`rec_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_purchase_balance_pay`;
CREATE TABLE `open_purchase_balance_pay` (
  `balance_pay_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `balance_order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `pay_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `pay_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `pay_date` int(10) unsigned NOT NULL DEFAULT '0',
  `trade_off_sn` varchar(255) NOT NULL DEFAULT '',
  `trade_off_date` int(10) unsigned NOT NULL DEFAULT '0',
  `pay_accounts` varchar(255) NOT NULL DEFAULT '',
  `pay_brief` tinytext NOT NULL,
  PRIMARY KEY (`balance_pay_id`),
  KEY `balance_order_id` (`balance_order_id`),
  KEY `pay_type` (`pay_type`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_purchase_payment`;
CREATE TABLE `open_purchase_payment` (
  `pay_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `pay_name` varchar(255) NOT NULL DEFAULT '',
  `pay_accounts` varchar(255) NOT NULL DEFAULT '',
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`pay_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_purchase_return_order`;
CREATE TABLE `open_purchase_return_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `supplier_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `depot_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `deliver_time` int(10) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`),
  KEY `depot_id` (`depot_id`),
  KEY `seat_id` (`seat_id`),
  KEY `supplier_id` (`supplier_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_purchase_return_order_goods`;
CREATE TABLE `open_purchase_return_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `norm_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `norm_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_mount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_brief` tinytext NOT NULL,
  PRIMARY KEY (`rec_id`),
  UNIQUE KEY `spec_unique` (`order_id`,`goods_id`,`size_id`,`color_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`),
  KEY `order_id` (`order_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `open_purchase_check_order`;
CREATE TABLE `open_purchase_check_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `depot_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `loss_order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`),
  KEY `depot_id` (`depot_id`),
  KEY `seat_id` (`seat_id`),
  KEY `loss_order_id` (`loss_order_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

#
# Source for table open_purchase_check_order_goods
#
DROP TABLE IF EXISTS `open_purchase_check_order_goods`;
CREATE TABLE `open_purchase_check_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `norm_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `norm_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_mount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_brief` tinytext NOT NULL,
  PRIMARY KEY (`rec_id`),
  UNIQUE KEY `un` (`order_id`,`goods_id`,`color_id`,`size_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`),
  KEY `order_id` (`order_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_confirm_order
#
DROP TABLE IF EXISTS `open_purchase_confirm_order`;
CREATE TABLE `open_purchase_confirm_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `supplier_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `depot_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `deliver_time` int(10) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  KEY `supplier_id` (`supplier_id`),
  KEY `depot_id` (`depot_id`),
  KEY `seat_id` (`seat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_confirm_order_goods
#
DROP TABLE IF EXISTS `open_purchase_confirm_order_goods`;
CREATE TABLE `open_purchase_confirm_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `norm_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `norm_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_mount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_brief` tinytext NOT NULL,
  `ext_goods_number_finish` smallint(5) unsigned NOT NULL DEFAULT '0',
  `ext_goods_number_unfinish` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`rec_id`),
  UNIQUE KEY `un` (`order_id`,`goods_id`,`color_id`,`size_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`),
  KEY `order_id` (`order_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_loss_order
#
DROP TABLE IF EXISTS `open_purchase_loss_order`;
CREATE TABLE `open_purchase_loss_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `depot_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number_loss` smallint(5) NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `rectify_order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`),
  KEY `depot_id` (`depot_id`),
  KEY `seat_id` (`seat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_loss_order_goods
#
DROP TABLE IF EXISTS `open_purchase_loss_order_goods`;
CREATE TABLE `open_purchase_loss_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number_inventory` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number_loss` smallint(5) NOT NULL DEFAULT '0',
  `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_norm_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_norm_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_actual_mount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_goods_brief` tinytext NOT NULL,
  PRIMARY KEY (`rec_id`),
  UNIQUE KEY `un` (`order_id`,`goods_id`,`color_id`,`size_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`),
  KEY `order_id` (`order_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_order
#
DROP TABLE IF EXISTS `open_purchase_order`;
CREATE TABLE `open_purchase_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `supplier_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `depot_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `deliver_time` int(10) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  KEY `supplier_id` (`supplier_id`),
  KEY `depot_id` (`depot_id`),
  KEY `seat_id` (`seat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_order_action
#
DROP TABLE IF EXISTS `open_purchase_order_action`;
CREATE TABLE `open_purchase_order_action` (
  `action_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `ctype` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `action_user` varchar(30) NOT NULL DEFAULT '',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `action_note` varchar(255) NOT NULL DEFAULT '',
  `log_time` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`action_id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_order_goods
#
DROP TABLE IF EXISTS `open_purchase_order_goods`;
CREATE TABLE `open_purchase_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `norm_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `norm_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `actual_mount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_brief` tinytext NOT NULL,
  `ext_goods_number_finish` smallint(5) unsigned NOT NULL DEFAULT '0',
  `ext_goods_number_unfinish` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`rec_id`),
  UNIQUE KEY `spec_unique` (`order_id`,`goods_id`,`size_id`,`color_id`),
  KEY `purchase_order_id` (`order_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_rectify_order
#
DROP TABLE IF EXISTS `open_purchase_rectify_order`;
CREATE TABLE `open_purchase_rectify_order` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(60) NOT NULL DEFAULT '',
  `depot_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `order_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `order_status` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `order_brief` tinytext NOT NULL,
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`),
  KEY `depot_id` (`depot_id`),
  KEY `seat_id` (`seat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

#
# Source for table open_purchase_rectify_order_goods
#
DROP TABLE IF EXISTS `open_purchase_rectify_order_goods`;
CREATE TABLE `open_purchase_rectify_order_goods` (
  `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `color_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `size_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number_inventory` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_number_rectify` smallint(5) NOT NULL DEFAULT '0',
  `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_norm_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_discount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_norm_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_actual_mount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `ext_goods_brief` tinytext NOT NULL,
  PRIMARY KEY (`rec_id`),
  UNIQUE KEY `un` (`order_id`,`goods_id`,`color_id`,`size_id`),
  KEY `goods_id` (`goods_id`),
  KEY `color_id` (`color_id`),
  KEY `size_id` (`size_id`),
  KEY `order_id` (`order_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_supplier_type`;
CREATE TABLE `open_supplier_type` (
  `supplier_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `supplier_type_name` varchar(60) NOT NULL DEFAULT '',
  `supplier_type_code` varchar(20) NOT NULL DEFAULT '',
  `supplier_type_desc` tinytext NOT NULL,
  `is_default` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`supplier_type_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_supplier`;
CREATE TABLE `open_supplier` (
  `supplier_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `supplier_code` varchar(20) NOT NULL DEFAULT '',
  `supplier_type` smallint(5) unsigned NOT NULL DEFAULT '0',
  `supplier_name` varchar(80) NOT NULL DEFAULT '',
  `is_balance` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `supplier_desc` tinytext NOT NULL,
  `address` varchar(120) NOT NULL DEFAULT '',
  `linkman` varchar(60) NOT NULL DEFAULT '',
  `principal` varchar(60) NOT NULL DEFAULT '',
  `zipcode` varchar(60) NOT NULL DEFAULT '',
  `office_phone` varchar(20) NOT NULL DEFAULT '',
  `mobile_phone` varchar(20) NOT NULL DEFAULT '',
  `fax` varchar(20) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `website` varchar(120) NOT NULL DEFAULT '',
  `bank_name` varchar(80) NOT NULL DEFAULT '',
  `bank_account` varchar(100) NOT NULL DEFAULT '',
  `tax_no` varchar(100) NOT NULL DEFAULT '',
  `legal_person` varchar(60) NOT NULL DEFAULT '',
  `supply_discount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `supply_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `balance_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `balance_type_date` int(10) unsigned NOT NULL DEFAULT '0',
  `finance_desc` tinytext NOT NULL,
  `supplier_status` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`supplier_id`),
  UNIQUE KEY `supplier_code` (`supplier_code`),
  KEY `supplier_type` (`supplier_type`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `open_supplier_goods`;
CREATE TABLE `open_supplier_goods` (
  `supplier_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `purchase_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `goods_brief` tinytext NOT NULL,
  `admin_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`supplier_id`,`goods_id`,`admin_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;